home *** CD-ROM | disk | FTP | other *** search
PiXCL source | 1996-08-12 | 5.4 KB | 191 lines |
- Initialize:
-
- WinGetActive(Win$)
- UseCoordinates(PIXEL)
- WinLocate(Win$,100,100,570,385,Res)
- Title$ = "PiXCL 4.0 Images and Rectangles"
- WinTitle(Win$, Title$)
- DirGet(SourceDir$)
- UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,0,0,0)
-
- WaitInput(100)
- SetMenu("&File",IGNORE,
- "E&xit",Leave,
- ENDPOPUP,
- "&Image Load",Image_Load,
- ENDPOPUP,
- "&Edge Rectangles",EdgeRect,
- ENDPOPUP,
- "&Help",IGNORE,
- "&Concept",Concept,
- "&View Source",ViewSource,
- SEPARATOR,
- "&About PiXCL",About_Pixcl,
- ENDPOPUP)
-
- Btn1 = 1
- Btn2 = 1
-
- Wait_for_Input:
- WaitInput()
-
-
- Leave:
- End
-
-
- ViewSource:
- PXL_File$ = SourceDir$ + "\thumb1.pxl"
- Cmd$ = "Notepad " + PXL_File$
- Run(Cmd$)
- Goto Wait_for_Input
-
- InvertRect:
- InvertRectangle(10,10,200,200)
- DrawStatusText(cx1,cy1,cx2,cy2,"Double Mouse pressed",NOBORDER)
- Goto Wait_for_Input
-
- Image_Load:
- UseBackGround(TRANSPARENT,192,192,192)
- DrawBackground
- DrawEdgeRectangle(6,6,205,205,SUNKENEDGE,ADJUST,RECT)
-
- Image$ = SourceDir$ + "\1iddnext.bmp"
- DrawSizedBitMap(10,10,200,200,Image$)
- UseCaption(Title$)
-
- DrawEdgeRectangle(220,20,285,85,ETCHEDEDGE,ADJUST, RECT)
- DrawEdgeRectangle(300,20,365,85,RAISEDEDGE,ADJUST,RECT)
-
- DrawText(230,90,"Button #1")
- DrawText(310,90,"Button #2")
-
- SetRightMouse(220,20,285,85,Btn1_Up,X,Y)
- SetMouse(220,20,285,85,Btn1_Down,X,Y,
- 300,20,365,85,Btn2,X,Y)
- SetCtrlMouse(220,20,285,85,Btn1_Gray,X,Y)
- SetShftRightMouse(300,20,365,85,Btn2off,X,Y)
- Btn2_Flag = 0
-
- WinGetClientRect(Title$,cx1,cy1,cx2,cy2)
- cx1 = 5 cx2 = cx2 - 2
- cy1 = cy2 - 22 cy2 = cy2 - 2
- DrawEdgeRectangle(cx1,cy1,cx2,cy2,SUNKENEDGE,ADJUST,RECT)
-
- SetDblMouse(10,10,200,200,InvertRect,X,Y)
- Goto Wait_for_Input
-
- Btn1_Up:
- DrawEdgeRectangle(220,20,285,85,RAISEDEDGE,ADJUST, RECT)
- DrawStatusText(cx1,cy1,cx2,cy2,"Right Mouse pressed",NOBORDER)
- If Btn1 = 0
- UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
- DrawText(231,91,"Button #1")
- UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,0,0,0)
- DrawText(230,90,"Button #1")
- Btn1 = 1
- Endif
- Goto Wait_for_Input
- Btn1_Down:
- DrawEdgeRectangle(220,20,285,85,SUNKENEDGE,ADJUST, RECT)
- DrawStatusText(cx1,cy1,cx2,cy2,"Left Mouse pressed",NOBORDER)
- If Btn1 = 0
- UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
- DrawText(231,91,"Button #1")
- UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,0,0,0)
- DrawText(230,90,"Button #1")
- Btn1 = 1
- Endif
- Goto Wait_for_Input
- Btn1_Gray:
- DrawEdgeRectangle(220,20,285,85,ETCHEDEDGE,ADJUST, RECT)
- UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
- DrawText(231,91,"Button #1")
- UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,128,128,128)
- DrawText(230,90,"Button #1")
- Btn1 = 0
- DrawStatusText(cx1,cy1,cx2,cy2,"Ctrl-Left Mouse pressed",NOBORDER)
- Goto Wait_for_Input
-
- Btn2:
- If Btn2_Flag = 1
- Btn2_Flag = 0
- DrawEdgeRectangle(300,20,365,85,SUNKENEDGE,ADJUST,RECT)
- Else
- Btn2_Flag = 1
- DrawEdgeRectangle(300,20,365,85,RAISEDEDGE,ADJUST,RECT)
- Endif
- If Btn2 = 0
- UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
- DrawText(311,91,"Button #2")
- UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,0,0,0)
- DrawText(310,90,"Button #2")
- DrawStatusText(cx1,cy1,cx2,cy2,"Left Mouse pressed",NOBORDER)
- Btn2 = 1
- Endif
- Goto Wait_for_Input
-
- Btn2off:
- DrawEdgeRectangle(300,20,365,85,ETCHEDEDGE,ADJUST,RECT)
- DrawStatusText(cx1,cy1,cx2,cy2,"Shift Right Mouse pressed",NOBORDER)
- UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,255,255,255)
- DrawText(311,91,"Button #2")
- UseFont("Arial",6,17,BOLD,NOITALIC,NOUNDERLINE,128,128,128)
- DrawText(310,90,"Button #2")
- Btn2 = 0
- Goto Wait_for_Input
-
-
- EdgeRect:
- SetRightMouse()
- SetMouse()
- SetCtrlMouse()
- SetShftRightMouse()
-
- UseBackGround(TRANSPARENT,192,192,192)
- DrawBackground
- UseBrush(SOLID,0,192,0)
- DrawEdgeRectangle(20,20,200,100,BUMPEDGE,ADJUST, RECT)
- DrawStatusText(32,32,190,90,"BUMP EDGE",NOBORDER)
-
- DrawEdgeRectangle(220,20,400,100,ETCHEDEDGE,ADJUST, RECT)
- DrawStatusText(232,32,390,90,"ETCHED EDGE",NOBORDER)
-
- DrawEdgeRectangle(20,120,200,200,RAISEDEDGE,ADJUST, RECT)
- DrawStatusText(32,132,190,190,"RAISED EDGE",NOBORDER)
-
- DrawEdgeRectangle(220,120,400,200,SUNKENEDGE,ADJUST, RECT)
- DrawStatusText(235,122,375,140,"SUNKEN EDGE",NOBORDER)
- DrawEdgeRectangle(240,150,380,190,RAISEDEDGE,ADJUST, RECT)
- DrawStatusText(245,155,375,185,"RAISED EDGE",NOBORDER)
-
-
- Goto Wait_for_Input
-
- Concept:
- MessageBox(OK,1,INFORMATION,
- "Menu item 'image load' displays a sized bitmap image and
- draws two buttons that demonstrate edge rectangles and
- mouse active regions.
-
- Button #1 will raise or depress with left or right mouse clicks,
- and become embossed and flat with a control-left click.
-
- Button #2 will alternately raise and depress with a left click,
- and become embossed and flat with a shift-right click.
-
- Double click the image and it the colors will invert.
-
-
- The 'Edge Rectangles' menu item displays the set of edge
- rectangle styles available.",
- "Using edge rectangles as buttons.", Res)
- Goto Wait_for_Input
-
- About_Pixcl:
- AboutUser("PiXCL 4.0 Sample Program","Displaying images with Buttons",
- "This program shows the image loading and mouse
- active areas. Try clicking the left, ctrl left, double
- and right mouse and shift-right mouse on the buttons.")
- Goto Wait_for_Input
-